// ignore_for_file: deprecated_member_use

import 'package:flutter/material.dart';
import 'package:barcode_widget/barcode_widget.dart';
import 'package:flutter_widget/custom/custom_appbar.dart';

class BarcodeWidgePage extends StatelessWidget {
  const BarcodeWidgePage({Key? key, required this.name}) : super(key: key);
  final String name;

  @override
  Widget build(BuildContext context) {
    return Material(
      child: Scaffold(
        // appBar: AppBar(

        //   // title: const Text('barcode_widge 生成二维码'),
        //   elevation: 10.0, // 阴影 默认4.0
        //   backgroundColor: Colors.blue,
        // ),
        appBar: CustomAppbar(name, Theme.of(context).primaryColor),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              BarcodeWidget(
                barcode: Barcode.qrCode(), // Barcode type and settings
                data:
                    'http://43.138.203.36:8086/flutter/#/', // Content
                width: 200,
                height: 200,
                color: Theme.of(context).primaryColor, // 二维码颜色
              ),
            ],
          ),
        ),
      ),
    );
  }
}
